<?php

namespace Home\Model;

class MatchTeamModel extends CommonModel {

    public function createMatchTeam($match_id){
        $dt = array(
            array(
                'match_id' => $match_id,
                'team_id' => $_POST['home_team_id'],
            ),
            array(
                'match_id' => $match_id,
                'team_id' => $_POST['away_team_id'],
            ),
        );

        foreach ($dt as $k => $v) {
            $rs = $this->add($v);
        }

        if ($rs) {
            $ret['status'] = true;
            $ret['msg'] = '操作成功！';
        } else {
            $ret['status'] = false;
            $ret['msg'] = $this->getError();
        }
        return $ret;
    }
}
